import { getMenuData } from '@ant-design/pro-layout';
import { Helmet, HelmetProvider } from 'react-helmet-async';
import React from 'react';
import logopng from '../assets/logo.png';
import styles from './UserLayout.less';

class UserLayout extends React.Component {

  componentDidMount(){
  }

  render () {
    const {
      route = {
        routes: [],
      },
    } = this.props;
    const { routes = [] } = route;
    const {
      children,
      location = {
        pathname: '',
      },
    } = this.props;
    // const { formatMessage } = useIntl();
    const { breadcrumb } = getMenuData(routes);
    const title = breadcrumb[location.pathname] && breadcrumb[location.pathname].name || 'PanoVideoCall'
    document.title = title
    
    
    // getPageTitle({
    //   pathname: location.pathname,
    //   // formatMessage,
    //   breadcrumb,
    //   ...this.props,
    // });
  
    return (
      this.props.history.location.pathname==='/meeting'?<>{children}</>
      :<HelmetProvider>
        <Helmet>
          <title>{title}</title>
          <meta name="description" content={title} />
        </Helmet>
  
        <div className={styles.container}>
          {/* <div className={styles.lang}>
            <SelectLang />
          </div> */}
          <div className={styles.content}>
            <div className={styles.top}>
              <div className={styles.header}>
                <div>
                  {/* <img alt="logo" className={styles.logo} src={logopng} /> */}
                  <span className={styles.title}>Nightly Test Config</span>
                </div>
              </div>
            </div>
            {children}
          </div>
          {/* <DefaultFooter /> */}
        </div>
      </HelmetProvider>
    );
  };
  }

export default UserLayout;
